﻿Public Class fBancos
    Dim daBanco As lbGlobalcom.dsBancosTableAdapters.GLO_BANCOSTableAdapter

    Private Sub btncargaBancos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncargaBancos.Click
        Try
            daBanco.Fill(DsBancos.GLO_BANCOS)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

    Private Sub GLO_BANCOSBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GLO_BANCOSBindingNavigatorSaveItem.Click
        Try
            Validate()
            GLO_BANCOSBindingSource.EndEdit()
            daBanco.Update(DsBancos.GLO_BANCOS)
            MessageBox.Show("Se salvarón bancos con exito", "Salvar bancos", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

    Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click
        Try
            If MessageBox.Show("Esta seguro que desea eliminar este banco", "Elimina banco", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
                GLO_BANCOSBindingSource.RemoveCurrent()
                GLO_BANCOSBindingSource.EndEdit()
                daBanco.Update(DsBancos.GLO_BANCOS)
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

    Private Sub fBancos_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            daBanco = New lbGlobalcom.dsBancosTableAdapters.GLO_BANCOSTableAdapter
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub
End Class